home *** CD-ROM | disk | FTP | other *** search
- {*********************************************************}
- {* OVCDBHIS.PAS 3.00 *}
- {* Copyright 1995-99 (c) TurboPower Software Co *}
- {* All rights reserved. *}
- {*********************************************************}
-
- {$I OVC.INC}
-
- {$IFNDEF VERSION3}
- !! Error - The DBISAM engine helper class is for Delphi 3+ only
- {$ENDIF}
-
- {$B-} {Complete Boolean Evaluation}
- {$I+} {Input/Output-Checking}
- {$P+} {Open Parameters}
- {$T-} {Typed @ Operator}
- {$W-} {Windows Stack Frame}
- {$X+} {Extended Syntax}
-
- {$IFNDEF Win32}
- {$G+} {286 Instructions}
- {$N+} {Numeric Coprocessor}
-
- {$C MOVEABLE,DEMANDLOAD,DISCARDABLE}
- {$ENDIF}
-
- unit OvcDbHIs;
- {DBISAM database engine helper class}
-
- {Notes: DBISAM is a database engine by Extended Systems.
- http://www.elevatesoft.com/
- DBISAM does not support aliases, hence all alias name support
- is defaulted to the ancestor.}
-
- interface
-
- uses
- {$IFDEF Win32} Windows, {$ELSE} WinTypes, WinProcs, {$ENDIF}
- Messages, SysUtils, Classes,
- OvcBase, Db, DBISAMTb, OvcDbHLL;
-
- type
- TOvcDbDBISAMEngineHelper = class(TOvcDbEngineHelperBase)
- {.Z+}
- protected {private}
- protected
- public
- {.Z-}
- {===GENERAL TABLE AND INDEX-BASED METHODS===}
- procedure FindNearestKey(aDataSet : TDataSet;
- const aKeyValues : array of const); override;
- {-position the dataset on the nearest record that matches the
- passed key}
- function GetIndexDefs(aDataSet : TDataSet) : TIndexDefs; override;
- {-return the index definitions for the given dataset}
- function GetIndexField(aDataSet : TDataSet;
- aFieldIndex : integer) : TField; override;
- {-return the TField object for the given field number in the
- current index.}
- function GetIndexFieldCount(aDataSet : TDataSet) : integer; override;
- {-return the number of fields in the key for the current index.}
- procedure GetIndexFieldNames(aDataSet : TDataSet;
- var aIndexFieldNames : string); override;
- {-return the field names for the current index for the given
- dataset}
- procedure GetIndexName(aDataSet : TDataSet;
- var aIndexName : string); override;
- {-return the name of the current index for the given dataset}
- function IsChildDataSet(aDataSet : TDataSet) : boolean; override;
- {-return whether the dataset is the detail part of a
- master/detail relationship (ie, the current index is 'locked'
- to the master dataset)}
-
- procedure SetIndexFieldNames(aDataSet : TDataSet;
- const aIndexFieldNames : string); override;
- {-set the current index to that containing the given fields for
- the given dataset}
- procedure SetIndexName(aDataSet : TDataSet;
- const aIndexName : string); override;
- {-set the current index to the given name for the given dataset}
-
- end;
-
-
- implementation
-
-
- {===TOvcDbDBISAMEngineHelper=========================================}
- procedure TOvcDbDBISAMEngineHelper.FindNearestKey(aDataSet : TDataSet;
- const aKeyValues : array of const);
- begin
- (aDataSet as TDBISAMTable).FindNearest(aKeyValues);
- end;
- {--------}
- function TOvcDbDBISAMEngineHelper.GetIndexDefs(aDataSet : TDataSet) : TIndexDefs;
- begin
- Result := (aDataSet as TDBISAMTable).IndexDefs;
- end;
- {--------}
- function TOvcDbDBISAMEngineHelper.GetIndexField(aDataSet : TDataSet;
- aFieldIndex : integer) : TField;
- begin
- Result := (aDataSet as TDBISAMTable).IndexFields[aFieldIndex];
- end;
- {--------}
- function TOvcDbDBISAMEngineHelper.GetIndexFieldCount(aDataSet : TDataSet) : integer;
- begin
- Result := (aDataSet as TDBISAMTable).IndexFieldCount;
- end;
- {--------}
- procedure TOvcDbDBISAMEngineHelper.GetIndexFieldNames(aDataSet : TDataSet;
- var aIndexFieldNames : string);
- begin
- aIndexFieldNames := (aDataSet as TDBISAMTable).IndexFieldNames;
- end;
- {--------}
- procedure TOvcDbDBISAMEngineHelper.GetIndexName(aDataSet : TDataSet;
- var aIndexName : string);
- begin
- aIndexName := (aDataSet as TDBISAMTable).IndexName;
- end;
- {--------}
- function TOvcDbDBISAMEngineHelper.IsChildDataSet(aDataSet : TDataSet) : boolean;
- begin
- Result := (aDataSet as TDBISAMTable).MasterSource <> nil;
- end;
- {--------}
- procedure TOvcDbDBISAMEngineHelper.SetIndexFieldNames(aDataSet : TDataSet;
- const aIndexFieldNames : string);
- begin
- (aDataSet as TDBISAMTable).IndexFieldNames := aIndexFieldNames;
- end;
- {--------}
- procedure TOvcDbDBISAMEngineHelper.SetIndexName(aDataSet : TDataSet;
- const aIndexName : string);
- begin
- (aDataSet as TDBISAMTable).IndexName := aIndexName;
- end;
- {====================================================================}
-
-
- end.
-